threshold=80
while [ 1 -gt 0 ]; do
	mystring=`AFSquota.sh | grep \%\ | tr -s " " | cut -d " " -f4 | cut -d "%" -f1 | tr "\n" " "`	
	myarray=($mystring)
#
	for ((i=0; i < ${#myarray[@]}; ++i)); do 
		echo "AFS quota used ${myarray[$i]}"; 
		if [ ${myarray[$i]} -gt $threshold ]; then
		 	AFSquota.sh > quota
			mutt -s "AFS quota warning " roberto.franceschini@cern.ch < quota
		fi	
	done
sleep 60
done
